<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>
		{% block title %}
		{% endblock %}
	</title>
	<link rel='stylesheet' href="/static/css/base.css">

	<script type="text/javascript" src="../static/tinymce/tinymce.min.js"></script>

	<link rel="stylesheet" href="../static/highlight/styles/monokai-sublime.min.css">
	<script type="text/javascript" src="../static/highlight/highlight.min.js"></script>
	<script>hljs.highlightAll();</script>

	<script type="text/javascript" async
			src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
	<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}})</script>
	<script>
        tinymce.init({
            selector: '.make_post',
            plugins: 'textpattern, code, lists, advlist, preview, table, autoresize, codesample',
            toolbar: [
                'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | outdent indent | link image',
                'forecolor backcolor | bullist numlist | preview | codesample',
            ],
            autoresize_bottom_margin: 200,
            textpattern_patterns: [
                {start: '*', end: '*', format: 'italic'},
                {start: '**', end: '**', format: 'bold'},
                {start: '# ', format: 'h1'},
                {start: '## ', format: 'h2'},
                {start: '### ', format: 'h3'},
                {start: '#### ', format: 'h4'},
                {start: '##### ', format: 'h5'},
                {start: '###### ', format: 'h6'},
                {start: '1. ', cmd: 'InsertOrderedList'},
                {start: '* ', cmd: 'InsertUnorderedList'},
                {start: '- ', cmd: 'InsertUnorderedList'}
            ],
            language: 'zh_CN',
            browser_spellcheck: true, // 拼写检查
            branding: true, // 去水印
            statusbar: false, // 隐藏编辑器底部的状态栏
            paste_data_images: true, // 允许粘贴图像
            menubar: true, // 隐藏最上方menu\
            width: 1000,
            height: 2000
        });
	</script>
</head>
<body>
<div class="menu">
	<div class="left_bar">
		<a class="menu_links" href={{ url_for('index') }}>首页</a>
		<a class="menu_links" href={{ url_for('problemset') }}>题目集</a>
		<a class="menu_links" href="">比赛</a>
		<a class="menu_links" href={{ url_for('show_submissions') }}>评测状态</a>
	</div>

	<div class="right_bar">
		{% if 'logged_in' in session %}
			{% if 'admin' in session %}
				<a class="menu_links" href={{ url_for('dashboard') }}>
					<span style="color:black; margin:0; padding:0; float:left">
						{{ session['user_name'][0] }}
					</span>
					<span style="margin: 0;padding:0;float:left">
						{{ session['user_name'][1:] }}
					</span>
				</a>
			{% else %}
				<a class="menu_links" href={{ url_for('dashboard') }}>{{ session['user_name'] }}</a>
			{% endif %}
			<a class="menu_links" href={{ url_for('logout') }}>注销</a>
		{% else %}
			<a class="menu_links" href={{ url_for('login') }}>登录</a>
			<a class="menu_links" href={{ url_for('register') }}>注册</a>
		{% endif %}
	</div>
</div>

<div>
	{% for message in get_flashed_messages() %}
		<p>{{ message }}</p>
	{% endfor %}
	{% block content %}
	{% endblock %}
</div>

</body>
</html>